//package com.bookcity.front.webfront.config;
//
//import com.bookcity.front.webfront.security.DouyinFilter;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.HttpMethod;
//import org.springframework.security.access.PermissionEvaluator;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.config.http.SessionCreationPolicy;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
//
///**
// * @author oldliu
// * @since 1.0
// */
//@Configuration
//@EnableWebSecurity
//@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
//public class WebConfig extends WebSecurityConfigurerAdapter {
//
////    @Autowired
////    private  DouyinConfig douyinConfig ;
////    @Autowired
////    private DouyinFilter filter;
////
////    @Autowired
////    private UserDetailsService userDetailsService;
//    //0private Jwt
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().authorizeRequests()
//                .antMatchers(HttpMethod.OPTIONS, "/**").permitAll().antMatchers("/member/login", "/*.html", "/js" +
//                "/jquery-3.4" +
//                ".1.min.js", "/**.css").permitAll()
//                //.antMatchers("/**").permitAll()
//                .anyRequest().authenticated();
//
//
//        // 禁用缓存
//        http.headers().cacheControl();
//        //http.addFilterBefore(filter, TokenFilter.class);
//        //http.addFilterBefore(filter, UsernamePasswordAuthenticationFilter.class);
//
//        //http.apply(douyinConfig);
//
//    }
//
////    @Override
////    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
////        //super.configure(auth);
////        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
////    }
//    @Bean
//    @Override
//    protected AuthenticationManager authenticationManager() throws Exception {
//        return super.authenticationManager();
//    }
//
//    public PasswordEncoder passwordEncoder() {
//        return new BCryptPasswordEncoder();
//    }
//}
